{*
    Collection Management action template file
    @author: trungdt
    @since: Jan 21, 2011
    @version: 1.0
*}
{permissions level=$smarty.const.UILEVEL_PERMISSIONS}  
 {if $permissions.administrate == 1}
    <a class="collection_add_icon" href="{link action=collection_edit module=rsnewsmodule }">{$_TR.add_new}</a></p>
 {/if}
{/permissions}
<div id="container">
<div class="with_sidebar" id="content">
    <h1 class="content-header">{$_TR.title}</h1>
    <ul class="project_list">
        {foreach name=a from=$data item=listing name=links}
            {math equation="x-1" x=$listing->rank assign=prev}
            {math equation="x+1" x=$listing->rank assign=next}
            {assign var=start_index value=$start_index+1 name=links}
            <li class="rsnews_collection_listing">
                {permissions level=$smarty.const.UILEVEL_PERMISSIONS}
                <div class="itemactions">
                    {if $permissions.administrate == 1}
                        <a href="{link action=collection_edit id=$listing->id src=$__loc->src}" title="Edit this entry">
                            <img src="{$smarty.const.ICON_RELATIVE}edit.png" title="{$_TR.alt_edit}" alt="{$_TR.alt_edit}" />
                        </a>
                        <a href="{link action=collection_delete id=$listing->id src=$__loc->src}" title="Delete this entry">
                            <img src="{$smarty.const.ICON_RELATIVE}delete.png" title="{$_TR.alt_delete}" alt="{$_TR.alt_delete}" />
                        </a>
                        {if $smarty.foreach.links.first == 0}
                            <a href="{link action=collection_rank_switch a=$listing->rank b=$prev id=$listing->id}">            
                            <img src="{$smarty.const.ICON_RELATIVE}up.png" title="{$_TR.alt_previous}" alt="{$_TR.alt_previous}" />
                            </a>
                        {/if}
                        {if $smarty.foreach.links.last == 0}
                            <a href="{link action=collection_rank_switch a=$next b=$listing->rank id=$listing->id}">
                            <img src="{$smarty.const.ICON_RELATIVE}down.png" title="{$_TR.alt_next}" alt="{$_TR.alt_next}" />
                            </a>
                        {/if}
                    {/if}
                </div>
                {/permissions}
                <h3><a href="javascript: void(0);">{$start_index}. {$listing->name}</a> - {$listing->shortname}</h3>
            </li>
        {/foreach}
       </ul>
    {paging current_page=$page pages=$pages action=collection_management module=rsnewsmodule}
    </div>
{permissions level=$smarty.const.UILEVEL_PERMISSIONS}  
 {if $permissions.administrate == 1}
        <a class="collection_add_icon" href="{link action=collection_edit }">{$_TR.add_new}</a>
 {/if}
{/permissions}
</div>
<div class="clear"></div>